<template>
  <div>
    <el-table :data="modelDetailData" style="width: 100%" ref="columnInfo">
      <el-table-column
       v-for="(item, index) in columnInfoData"
              :key="index"
              :label="displayAlias?item.title:item.name"
              :width="index!=columnInfoData.length-1?'150':''"
              :prop="item.name"></el-table-column>
    </el-table>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    displayAlias: {
      type: Boolean,
      required: true
    },
    displayNumber: {
      type: Number,
      required: true
    },
    tableId: {
      type: Number,
      required: true
    },
    columnInfoData: {
      type: Array
    }
  },
  data() {
    return {
        modelDetailData:[]
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
      this.getModelDataDetail();
  },
  methods: {
      //查询模型详细方法
      //应该有一个统一的入口 目前先临时建一个入口创建数据
    getModelDataDetail() {
      var _this = this;
      _this.tableId=111111;
      this.axios
        .post(this.HOST + "modelcolumn/getModelDataDetail", {
          tableId: _this.tableId
        })
        .then(function(res) {
          res = res.data;
          if (res.status == "1") {
            _this.modelDetailData = res.data;
          } else {
            console.log(res.stackmessage);
          }
        })
        .catch(function(err) {
          console.log(err);
        });
    }
  }
};
</script>
<style scoped>

</style>
